new Vue({
    el:'#app',
    data:{
        activeName: 'first',
        caseId:'',    //修改案件选择的案件id
        tableData: [],
        tableLoading:false,
        radio: '',  //表格单选绑定值
        dialogVisible: false,
        nextdis:true
    },
    methods:{
        onSubmit() {
            console.log('submit!');
        },
        demo(){
            this.dialogVisible=true; //打开模态框
            this.tableLoading = true; //开启加载
            //打开模态框的时候查询案件
            this.$http.post("http://localhost:8080/law/selectLikeList",
                {emulateJSON:true}).then(result=>{
                var msg = eval("("+result.body+")");
                this.tableData = msg.data;
                this.tableLoading = false;//关闭加载
            });
        },
        handleClick(tab, event) {  //导航切换
            console.log(tab, event);
        },
        handleClose(done) { //点击模态框外是否关闭。
            this.$confirm('确认关闭？')
                .then(_ => {
                    done();
                })
                .catch(_ => {});
        },
        dialogVisible_select() { //关闭的时候加选择的案件赋值。
            if (this.radio == '') {
                alert("请选择案件");
                return ;
            }
            //如果选择了案件就将案件的案号 和对应的委托人赋值
            var  msg = this.tableData;
            for (var i = 0; i<msg.length; i++){
                if(msg[i].caseId == this.radio){
                    this.caseId = msg[i].caseId;
                    this.dialogVisible = false;
                    this.nextdis = false;
                    return;
                }
            }
        },
        next_update(){ //跳转到修改页面
            localStorage.setItem("message01_caseid",this.caseId);
            window.location.href="Case_update.html";
        }
    }
});